const state = {
	tabBar:[
			{
				iconPath: "/static/img/home_0.png",
				selectedIconPath: "/static/img/home_1.png",
				text: "员工",
				size:'small',
				completed:true,
			},
			{
				iconPath: "/static/img/manager_0.png",
				selectedIconPath: "/static/img/manager_1.png",
				text: "管理",
				size:'small',
				completed:false
			},
			{
				iconPath: "/static/img/me_0.png",
				selectedIconPath: "/static/img/me_1.png",
				text: "我的",
				size:'small',
				completed:true
			}
	],
	now_page_index:0,
};
const mutations = {
	change_page(state,index){
		state.now_page_index = index;
	}
	/* state.commit("change_nav_list",change_page) */
};
const getters = {
	//第一次才会执行
	//console.log("HELLO WORLD");
	completedTodos: state => {
		console.log("HELLO WORLD")
		uni.getStorage({
			key:'loginData',
			success: res=> {
				console.log(res.data.move_admin);
				if(res.data.move_admin==0){     //只有两个菜单
					state.tabBar[1].completed = false;
				}else if(res.data.move_admin==1){    ////只有三个菜单
					state.tabBar[1].completed = true;
				}
			}
		})
	    return state.tabBar.filter(todo => todo.completed);
	},
};
export default {
	state,
	getters,
	mutations
}